const express = require('express')
const app = express()
const bodyParser = require('body-parser')
const homeRouter = require('./routers/home')
const newsRouter = require('./routers/news')
const uploadRouter = require('./routers/upload')
// 静态资源处理
app.use(express.static('./public'))
app.use(bodyParser.urlencoded({extended:false}))
app.use(bodyParser.json())
// 设置模板引擎
app.set("views","./views");
app.set("view engine","ejs");

app.use(homeRouter)
app.use(newsRouter)
app.use(uploadRouter)

app.listen(5000,()=>{console.log("start at port 5000")})